<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
	xmlns:a="http://richfaces.org/a4j"
    template="/layout/template.xhtml">

<ui:define name="body">
	<s:link id="myRequests" view="/acab/request/MyRequests.xhtml" value="Back to My Requests" propagation="begin" rendered="#{identity.loggedIn}"/>

	
	<rich:simpleTogglePanel switchType="client" label="Request Info" height="90px">
		<h:panelGrid>
			Name:<h:outputText value="#{requestBean.request.name}"/>
		</h:panelGrid>
 	</rich:simpleTogglePanel>
			
    <rich:panel>
		<f:facet name="header">Suggestions for this request</f:facet>   
		<h:panelGrid >
		
			<h:outputText value="No suggestions for this request"
               rendered="#{empty requestBean.request.suggestions}"/>
               
           

			<rich:dataTable id="myRequestsBean"
		                   var="_suggestion"
		                 value="#{requestBean.suggestions}"
		              rendered="#{not empty requestBean.request.suggestions}">
         
				<h:column>
		            <f:facet name="header">Quality</f:facet>
		            <h:outputText value="#{_suggestion.suggestioninfo.quality}"/>
		        </h:column>
		        
		        <h:column>
		            <f:facet name="header">Info</f:facet>
		            <h:outputText value="#{_suggestion.suggestioninfo.infoMsg}"/>
		        </h:column>
		        
		        <h:column>
		            <f:facet name="header">Users</f:facet>
		            <rich:dataList var="_sugg" value="#{_suggestion.suggestioninfo.suggestions}">
		            	<h:outputText value="#{_sugg.request.user.name} "/>
		            </rich:dataList>
		        </h:column>
		        
		        <h:column>
		            <s:link view="/acab/suggestion/ViewSuggestion.xhtml"
		                   value="Chat"
		             propagation="begin"
		                      id="suggestionViewId"
		                      action="#{suggestionBean.loadSuggestionAction}">
		                <f:param name="idSuggestion"
		                        value="#{_suggestion.idSuggestion}"/>
		            </s:link>
		        </h:column>
		        
 		    </rich:dataTable>          

		
		
		  
		</h:panelGrid>
	</rich:panel>		    
        
</ui:define>
</ui:composition>
